#include <cstdio>
#include <cmath>

int main( )
{
    int t, cas = 1;
    double a, b, c, d, maxn, p, s;
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%lf%lf%lf%lf", &a, &b, &c, &d);
        maxn = a;
        if ( maxn < d ) maxn = d;
        if ( maxn < b ) maxn = b;
        if ( maxn < c ) maxn = c;
        if ( a + b + c + d <= 2 * maxn )
        {
            printf("Case %d: -1\n", cas++);
            continue;
        }
        p = ( a + b + c + d ) / 2;
        s = sqrt( ( p - a ) * ( p - b ) * ( p - c ) * ( p - d ) );
        printf("Case %d: %.6lf\n", cas++, s);
    }
    return 0;
}
